package com.giraffe.device.controller.api;


import com.giraffe.device.pojo.dto.DeviceDTO;
import com.giraffe.device.service.DeviceService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 设备(Device)表相关的http接口
 *
 * @author makejava
 * @since 2023-02-14 10:39:59
 */
@RestController
@RequestMapping("/api/device")
@Slf4j
@Api(tags = "产品：Device：产品")
public class DeviceApiController {
  /**
  * 服务对象
  */
  @Resource
  private DeviceService deviceService;

  @GetMapping("v1/getDevice")
  public DeviceDTO getDevice(@RequestParam("deviceId") String deviceId){
    return deviceService.getDevice(deviceId);
  }

  @PostMapping("v1/setDeviceStatus")
  public Boolean setDeviceStatus(@RequestBody DeviceDTO dto) {
    return deviceService.setDeviceStatus(dto);
  }
}
